package com.sc.nft.util;

import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * 音频
 */
public class AudioUtil {

    public static  List<String> videoList = Lists.newArrayList("MP4","TS","MOV","MXF","MPG","FLV","M4V","F4V","MPEG","3GP","ASF","MKV");
    public static  List<String> audioList = Lists.newArrayList("MP3","OGG","WAV","WMA","APE","FLAC","AAC","AC3","MMF","AMR","M4A","M4R","WV","MP2");


    public static Integer decision(String info) {
        if (StrUtil.isEmpty(info)) {
            return 0;
        }
        boolean b = StrUtil.containsAnyIgnoreCase(info, videoList.toArray(new String[videoList.size()]));
        if (b) {
            return 1;
        }
        boolean a = StrUtil.containsAnyIgnoreCase(info, audioList.toArray(new String[videoList.size()]));
        if (a) {
            return 2;
        }
        return 0;
    }

}
